//
//  Critical.m
//  D&D Manager
//
//  Created by Matthew Hutton on 10/07/2007.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "Critical.h"


@implementation Critical
+ (Class)transformedValueClass{
	return [NSString class];
}
+ (BOOL)allowsReverseTransformation{
	return NO;
}
- (id)transformedValue:(id)value{
	int minCrit=[[value valueForKey:@"minRollForCritical"] intValue];
	if(minCrit==20){
		return [NSString stringWithFormat:@"x%@",[value valueForKey:@"criticalMultiplier"]];
	}else{
		return [NSString stringWithFormat:@"%d-20/x%@",minCrit,[value valueForKey:@"criticalMultiplier"]];
	}
}
@end
